import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { GoldTypeListEntity } from '../../entity/list';
import { GoldTypeListService } from '../../service/list';
import { GoldTypeSetMealListService } from '../../service/gold_set_meal'

/**
 * gold模块-类型列表
 */
@CoolController({
  prefix: "/apid/gold",
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: GoldTypeListEntity,
  service: GoldTypeListService,
  pageQueryOp: {
    keyWordLikeFields: ['name'],
    fieldEq: ['amount', 'gold'],
  }
})
export class AdminGoldTypeListController extends BaseController {
  @Inject()
  goldTypeListService: GoldTypeListService;

  @Inject()
  goldTypeSetMealListService: GoldTypeSetMealListService

  @Get('/setMeal', { summary: '解锁用户动态' })
  async setMeal(@Query() BodyData: any) {
    return this.ok(await this.goldTypeSetMealListService.setMeal(BodyData));
  }

}
